home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Button;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dialog;
- import java.awt.Event;
- import java.awt.Font;
- import java.awt.Frame;
- import java.awt.Label;
- import java.awt.LayoutManager;
- import java.awt.Rectangle;
-
- public class AboutDialog extends Dialog {
- Button okButton;
- Label labelAbout;
-
- void okButton_Clicked(Event event) {
- ((Component)this).hide();
- }
-
- public AboutDialog(Frame parent, boolean modal) {
- super(parent, modal);
- ((Container)this).setLayout((LayoutManager)null);
- ((Dialog)this).addNotify();
- ((Component)this).resize(((Container)this).insets().left + ((Container)this).insets().right + 335, ((Container)this).insets().top + ((Container)this).insets().bottom + 86);
- ((Component)this).setFont(new Font("Dialog", 1, 12));
- ((Component)this).setForeground(new Color(0));
- ((Component)this).setBackground(new Color(16777215));
- this.okButton = new Button("OK");
- this.okButton.reshape(((Container)this).insets().left + 128, ((Container)this).insets().top + 48, 72, 26);
- this.okButton.setFont(new Font("Dialog", 1, 12));
- ((Container)this).add(this.okButton);
- this.labelAbout = new Label("Amazing Adventures Travel - Custom Itinerary Application");
- this.labelAbout.reshape(((Container)this).insets().left + -8, ((Container)this).insets().top + 8, 344, 31);
- this.labelAbout.setFont(new Font("Dialog", 1, 12));
- this.labelAbout.setForeground(new Color(0));
- this.labelAbout.setBackground(new Color(16777215));
- ((Container)this).add(this.labelAbout);
- ((Dialog)this).setTitle("About");
- ((Dialog)this).setResizable(false);
- }
-
- public AboutDialog(Frame parent, String title, boolean modal) {
- this(parent, modal);
- ((Dialog)this).setTitle(title);
- }
-
- public synchronized void show() {
- Rectangle bounds = ((Component)this).getParent().bounds();
- Rectangle abounds = ((Component)this).bounds();
- ((Component)this).move(bounds.x + (bounds.width - abounds.width) / 2, bounds.y + (bounds.height - abounds.height) / 2);
- super.show();
- }
-
- public boolean handleEvent(Event event) {
- if (event.id == 201) {
- ((Component)this).hide();
- return true;
- } else {
- if (event.target == this.okButton && event.id == 1001) {
- this.okButton_Clicked(event);
- }
-
- return super.handleEvent(event);
- }
- }
- }
-